package com.software.car.common.utils;


import java.util.ArrayList;
import java.util.List;

/**
 *
 * 构造和转换选项的默认值
 *
 * @Author 魔法はまだ解けない
 * @Date 2021/2/21
 */
public class FormChangeUtils {

    public static String getString(List<String> values) {
        StringBuffer stringBuffer = new StringBuffer();
        values.forEach(value->{
            String content = value.replaceAll("\n", "<bb>");
            stringBuffer.append(content);
            stringBuffer.append("\n");
        });
        return stringBuffer.toString();
    }

    public static List<String> getList(String values) {
        if (values==null){
            return null;
        }
        List<String> list=new ArrayList<String>();
        String[] strs = values.split("\n");
        for (int i = 0; i < strs.length; i++) {
            strs[i]=strs[i].replaceAll("<bb>","\n");
            list.add(strs[i]);
        }
        return list;
    }

}